﻿@model IEnumerable<Site3AI.Models.CmsCatalog>

@{
    ViewBag.Title = "健康知识库";
    ViewBag.Back = "/";
}


@*<ul data-role="listview" data-inset="true">
    @foreach (var h in SiteUser.UserAllRecupers.Select(v => v.Hospital).Distinct())
    {
        <li data-role="list-divider">@h.HospName</li>
        
        foreach (var item in Model.Where(v => v.Hospitals.Contains(h)).OrderByDescending(v => v.SortIdx))
        {
        
            foreach (var si in item.SubCmsCatalogs.OrderByDescending(v => v.SortIdx))
            {
                <li>@Html.ActionLink(si.Title, "KBCata", new { id = si.ID })</li>
            }
        }
    }
</ul>*@
@if (Model == null || Model.Count() == 0)
{
    <p class="data-empty">暂时还没有信息！</p>
}
else
{
    <div data-role="collapsible-set" data-inset="false" data-corners="false">
        @foreach (var h in SiteUser.UserAllRecupers.Select(v => v.Hospital).Distinct())
        {
            <div data-role="collapsible" data-inset="false" data-corners="false">
                <h2>@h.HospName</h2>
                <ul data-role="listview" data-inset="false" data-corners="false">
                    @foreach (var item in Model.Where(v => v.Hospitals.Contains(h)).OrderByDescending(v => v.SortIdx))
                    {

                        foreach (var si in item.SubCmsCatalogs.OrderByDescending(v => v.SortIdx))
                        {
                        <li>
                            <p>
                                @Html.ActionLink(si.Title, "KBCata", new { id = si.ID })
                            </p>
                        </li>
                        }
                    }
                </ul>
            </div>
        }
    </div>
}